<?php
require_once '../common/RootPath.php';
RootPath::importPath("interceptor/RouteHandler.php");
RootPath::importPath("common/Pagination.php");
RootPath::importPath("dto/QueryDto.php");
RootPath::importPath("dao/ArticleMapper.php");
RootPath::importPath("common/DaoUtils.php");
class ArticleHandler extends RouteHandler
{

    public function selectAllByPage($args)
    {
        $pagination = new Pagination($args);

        //$mapper = DaoUtils::getMapper(ArticleMapper);
        $mapper = new ArticleMapper();
        $list = $mapper->selectAllPage($pagination);
        var_dump($list);
        /* $list = $mapper->selectAllPage($pagination);
          echo $list;
        var_dump($pagination);
         echo is_null($pagination->getPage())?1:$pagination->getPage();*/

    }
    public function selectByFiltersWithLimit($args)
    {
       /* $queryDto = new QueryDto($args);
        $pagination = new Pagination($args);
        $mapper = DaoUtils::getMapper(ArticleMapper);
        echo $mapper->selectByKeywordPaged($queryDto, $pagination);*/
    }

    public function getUserById()
    {
        echo "userid";
    }

    public function getUserByName()
    {
        return "username";
    }

    public function update()
    {
        echo 1;
    }
}